home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoOpenPane.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  3.0 KB  |  91 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2005 Peter Simonsson <psn@linux.se>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.  * Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef KOOPENPANE_H
  20. #define KOOPENPANE_H
  21.  
  22. #include <koOpenPaneBase.h>
  23.  
  24. class KoCustomDocumentCreator;
  25. class KConfig;
  26. class KoTemplateGroup;
  27. class KoOpenPanePrivate;
  28. class KInstance;
  29. class QPixmap;
  30. class KListViewItem;
  31. class KoTemplatesPane;
  32. class KoDetailsPaneBase;
  33.  
  34. class KoOpenPane : public KoOpenPaneBase
  35. {
  36.   Q_OBJECT
  37.  
  38.   public:
  39.     /**
  40.      * Constructor
  41.      * @param parent the parent widget
  42.      * @param instance the KInstance to be used for KConfig data
  43.      * @param templateType the template-type (group) that should be selected on creation.
  44.      */
  45.     KoOpenPane(QWidget *parent, KInstance* instance, const QString& templateType = QString::null);
  46.     virtual ~KoOpenPane();
  47.  
  48.     QListViewItem* addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight);
  49.     QListViewItem* addPane(const QString& title, const QPixmap& icon, QWidget* widget, int sortWeight);
  50.  
  51.     /**
  52.      * If the application has a way to create a document not based on a template, but on user
  53.      * provided settings, the widget showing these gets set here.
  54.      * @see KoDocument::createCustomDocumentWidget()
  55.      * @param widget the widget.
  56.      */
  57.     void setCustomDocumentWidget(QWidget *widget);
  58.  
  59.   protected slots:
  60.     void showOpenFileDialog();
  61.  
  62.     void selectionChanged(QListViewItem* item);
  63.     void itemClicked(QListViewItem* item);
  64.  
  65.     /// Saves the splitter sizes for KoDetailsPaneBase based panes
  66.     void saveSplitterSizes(KoDetailsPaneBase* sender, const QValueList<int>& sizes);
  67.  
  68.   signals:
  69.     void openExistingFile(const QString&);
  70.     void openTemplate(const QString&);
  71.  
  72.     /// Emitted when the always use template has changed
  73.     void alwaysUseChanged(KoTemplatesPane* sender, const QString& alwaysUse);
  74.  
  75.     /// Emitted when one of the detail panes have changed it's splitter
  76.     void splitterResized(KoDetailsPaneBase* sender, const QValueList<int>& sizes);
  77.  
  78.   protected:
  79.     void initRecentDocs();
  80.      /**
  81.       * Populate the list with all templates the user can choose.
  82.       * @param templateType the template-type (group) that should be selected on creation.
  83.       */
  84.     void initTemplates(const QString& templateType);
  85.  
  86.   private:
  87.     KoOpenPanePrivate* d;
  88. };
  89.  
  90. #endif //KOOPENPANE_H
  91.